# Contributor: Minecrell <minecrell@minecrell.net>
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=tinycompress
pkgver=1.2.5
pkgrel=2
pkgdesc="Userspace library for ALSA compressed APIs"
url="https://alsa-project.org/"
arch="all"
license="BSD-3-Clause OR LGPL-2.1-only"
makedepends="linux-headers ffmpeg-dev"
subpackages="$pkgname-dev $pkgname-fcplay"
source="https://alsa-project.org/files/pub/tinycompress/tinycompress-$pkgver.tar.bz2"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-fcplay
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

fcplay() {
	pkgdesc="$pkgdesc (fcplay tool)"
	license="LGPL-2.1-only"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/fcplay "$subpkgdir"/usr/bin/fcplay
}

sha512sums="
52c6a284c49477d8bedccedc1170cbe1eec124ac27b55f86de7cebb81f2a67f884ac9a1ce15b8ad493c2a6aa0af1631f6042d5f9bfab46ba0533fa265f754e89  tinycompress-1.2.5.tar.bz2
"
